package entitiesIds;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * CoursestudentId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class CoursestudentId implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -8931622092473855963L;
	private Integer idStudent;
	private Integer idCourse;

	// Constructors

	/** default constructor */
	public CoursestudentId() {
	}

	/** full constructor */
	public CoursestudentId(Integer idStudent, Integer idCourse) {
		this.idStudent = idStudent;
		this.idCourse = idCourse;
	}

	// Property accessors

	@Column(name = "idStudent", nullable = false)
	public Integer getIdStudent() {
		return this.idStudent;
	}

	public void setIdStudent(Integer idStudent) {
		this.idStudent = idStudent;
	}

	@Column(name = "idCourse", nullable = false)
	public Integer getIdCourse() {
		return this.idCourse;
	}

	public void setIdCourse(Integer idCourse) {
		this.idCourse = idCourse;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof CoursestudentId))
			return false;
		CoursestudentId castOther = (CoursestudentId) other;

		return ((this.getIdStudent() == castOther.getIdStudent()) || (this
				.getIdStudent() != null && castOther.getIdStudent() != null && this
				.getIdStudent().equals(castOther.getIdStudent())))
				&& ((this.getIdCourse() == castOther.getIdCourse()) || (this
						.getIdCourse() != null
						&& castOther.getIdCourse() != null && this
						.getIdCourse().equals(castOther.getIdCourse())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getIdStudent() == null ? 0 : this.getIdStudent().hashCode());
		result = 37 * result
				+ (getIdCourse() == null ? 0 : this.getIdCourse().hashCode());
		return result;
	}

	@Override
	public String toString() {
		return "CoursestudentId [idStudent=" + idStudent + ", idCourse="
				+ idCourse + "]";
	}

	
}